#ifndef STEREO_CAPTURE_H
#define STEREO_CAPTURE_H
#include <stdio.h>
#include <stdlib.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/statfs.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <pthread.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <signal.h>
#include <termios.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#include <assert.h>
#include <stdint.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <chrono>

#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>

class StereoCapture
{
public:
	StereoCapture();
	~StereoCapture();

	typedef void (*stereoLeftVideoCallback)(cv::Mat image, long long timestamp);

	bool registerStereoLeftVideoCallback(stereoLeftVideoCallback function);

	typedef void (*stereoRightVideoCallback)(cv::Mat image, long long timestamp);

	bool registerStereoRightVideoCallback(stereoRightVideoCallback function);

	bool startVideoCapture();
private:
	stereoLeftVideoCallback m_leftVideoCallbackFunction;
	stereoRightVideoCallback m_rightVideoCallbackFunction;

	int m_width;
	int m_height;
	int m_fps;
};

extern StereoCapture StereoCaptureHandler;
#endif//STEREO_CAPTURE_H